package insultGen.systemFiles;

import android.app.Activity;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class SendMessage extends Activity{

	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sms);
        
        final SmsManager smsMan = SmsManager.getDefault();
        
        final EditText message = (EditText) findViewById(R.id.sms_text);
        final EditText number = (EditText) findViewById(R.id.sms_number);
        
        message.setText(Options.getMessage());
        
        Button send = (Button) findViewById(R.id.sms_send);
        send.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				smsMan.sendTextMessage(number.getText().toString(), null, message.getText().toString(), null, null);
				
				finish();
			}
		});
        Button back = (Button) findViewById(R.id.sms_back);
        back.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				finish();
			}
		});
	}
	
}
